<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let bankCost = +prompt('输入银行卡余额')
      let foodCost = +prompt('输入当月食宿消费金额')
      let lifeCost = +prompt('输入当月生活消费金额')

      function getSum(a, b, c) {
        return a - b - c
      }
      let restCost = getSum(bankCost, foodCost, lifeCost)
      document.write(restCost)
    </script>
  </body>
</html>
